import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

/* 首页 */
import home from '../views/home'


// 公共路由
export const constantRoutes = [{
        path: '/',
        redirect: '/home'
    }, {
        path: '/home',
        name: 'home',
        component: home
    }
];
const originalPush = Router.prototype.push;
Router.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err);
}
//  base: '/compage/',
export default new Router({
    mode: 'history', // 去掉url中的
    scrollBehavior: () => ({ y: 0 }),
    routes: constantRoutes
})